The present invention relates to a method, apparatus or software for managing a transactional message queue in a computer system.
One way in which application programs on computer systems communicate with each other is via message oriented middleware (MOM). MOM products provide the architecture for managing the flow of messages between communicating programs that may otherwise be difficult to integrate. Some MOMs comprise a message provider, which uses a message queue to manage the passing of messages between message producers and message consumers. Other MOM implementations broadcast or multicast messages instead of using point-to-point asynchronous communication via queues.
MOMs may be used in conjunction with a transaction processing system (TPS). TPSs are data processing systems in which processing is divided into distinct elements or units of work called transactions. After the processing of each transaction is complete, the results of the processing are saved using a commit command. A commit command ensures that changed data is either saved successfully or, if a fault occurs during the save, none of the changes within a transaction are applied until they can all be successfully applied. This ensures that data does not become lost or corrupted and can be returned or rolled back to a known state in the event of a fault.
In typical MOMs, message producers send messages to a message provider, which stores the messages on a message queue in the order they are received. In one group of such systems, referred to as point-to-point systems, the destination queue of each message may be specifically identified in the message. Alternatively, a publish/subscribe system may be used in which messages are identified by a topic and message consumers subscribe to a given topic by registering their interest with the message provider. In either system, the message provider sends the messages from the head of the queue to their appropriate message consumers, or the message consumer pulls messages from the message provider. In some systems, messages are streamed to message consumers. In other words, messages are sent from the queue without waiting for a specific request or acknowledgement for each message from the message consumer. In a transactional system, a problem can occur when one of a stream of messages to a message consumer crosses with a request, from that message consumer to the message provider, to commit a transaction. This can result in a message that has not been processed by the message consumer being removed from the message queue. Thus if, for example, a system crash occurs during the commit process, the message that crossed with the commit request may be lost, effectively corrupting the message queue.